#include <stdio.h>
#include <string.h>

#define Mod 1000000007

int main()
{
	int n, m, k;
	scanf("%d %d %d", &n, &m, &k);
	char s[100000], ss[100000];
	scanf("%s %s", s, ss);
	int dp[2][m + 1][k + 1];
	int res[2][m + 1][k + 1];
	//将dp,res初始化为0
	memset(dp, 0, sizeof(dp));
	memset(res, 0, sizeof(res));
	dp[0][0][0] = 1;
	for (int i = 1; i <= n; ++i)
	{
		int now = i % 2;
		dp[now][0][0] = 1;
		for (int j = 1; j <= m; ++j)
		{
			for (int h = 1; h <= k; ++h)
			{
				dp[now][j][h] = dp[1 - now][j][h];
				res[now][j][h] = 0;
				if (s[i - 1] == ss[j - 1])
				{
					res[now][j][h] = (dp[1 - now][j - 1][h - 1] + res[1 - now][j - 1][h]) % Mod;
					dp[now][j][h] = (dp[now][j][h] + res[now][j][h]) % Mod;
				}
			}
		}
	}
	printf("%d", dp[n % 2][m][k]);
	return 0;
}
